/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.shop.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.shop.entity.Navigation;
import com.thinkgem.jeesite.modules.shop.dao.NavigationDao;

/**
 * 导航管理Service
 * @author xxs
 * @version 2016-03-03
 */
@Service
@Transactional(readOnly = true)
public class NavigationService extends TreeService<NavigationDao, Navigation> {

	public Navigation get(String id) {
		return super.get(id);
	}
	
	public List<Navigation> findList(Navigation navigation) {
		if (StringUtils.isNotBlank(navigation.getParentIds())){
			navigation.setParentIds(","+navigation.getParentIds()+",");
		}
		return super.findList(navigation);
	}
	
	@Transactional(readOnly = false)
	public void save(Navigation navigation) {
		super.save(navigation);
	}
	
	@Transactional(readOnly = false)
	public void delete(Navigation navigation) {
		super.delete(navigation);
	}
	
}